#include <iostream>
using namespace std;


int main()
{
    string str;
    cin >> str;
    int sum = 0, count = 1, n = str.size();

    for (int i = 0; i < n - 1; i++)
    {
        if (str[i] >= '0' && str[i] <= '9')
        {
            sum += (str[i] - '0') * count;
            count++;
        }
    }

    sum %= 11;
    if (sum == str[n - 1] - '0' || (sum == 10 && str[n - 1] == 'X'))
    {
        cout << "Right" << endl;
    }
    else
    {
        str[n - 1] = sum == 10 ? 'X' : sum + '0';
        cout << str << endl;
    }
    return 0;
}